
<div id="select-form" >
  <% form_tag '' ,:method=>:get do -%>
    <table class="form"><tr>
        <td>
          <label for="class">Class</label><br />
          <%= select_tag 'class', options_for_select(@cond_class_names,@p_class) %>
        </td>

        <td>
          <label for="Device">Device</label><br />
          <%= select_tag 'device', options_for_select(@cond_devices,@p_device) %>
        </td>

        <td>
          <label for="date">Date</label><br />
          <%= select_tag 'date', options_for_select(@cond_date,@p_date) %>
        </td>

        <td>
          <br>
          <input id="button_search" class="button" type="submit" value="Search" tabindex="5" />
        </td>
    </tr></table>
  <% end -%>

</div>

<% if @summary != nil %>
  <div id="test_summary">
    <h3>Summary</h3>
    <table>
      <tr>
        <th>Project</th>
        <th>Class</th>
        <th>Device</th>
        <th>Test Date/Time</th>
        <th>Pass</th>
        <th>Fail</th>
      </tr>
      <tr>
        <td><%= @summary.project.name %></td>
        <td><%= @summary.class_name %></td>
        <td><%= @summary.device %></td>
        <td><%= @summary.formatted_date %></td>
        <td class="pass"><%= @summary.pass %></td>
        <td class="fail"><%= @summary.fail %></td>
          </tr>
        </table>
        <br>
      </div><!--test_summary -->
    <% end %>



    <% if @test_cases != nil %>
      <h3>TestCase</h3>

      <table width="1500">
        <tr>
          <th width="50px">Result</th>
          <th width="100px">Test name</th>
          <th width="200px">Test procedure</th>
          <th width="200px">Confirmation contents</th>
          <th width="200px">Error Trace</th>
          <th width="200px">Memory Info</th>
          <th>Screenshots</th>
        </tr>

        <% @test_cases.each do |test_case| %>
          <tr>
              <% if test_case.result == "Pass" then %>
                <td class="pass">Pass</td>
            <% else %>
                <td class="fail">Fail</td>
            <% end %>
            <td><%= test_case.test_name %></td>
            <td><%= test_case.test_procedure %></td>
            <td><%= test_case.confirmation_contents %></td>
            <td><%= test_case.trace %></td>
            <td><%= test_case.memory_info %></td>
            <td>
            <% paths = test_case.screen_shot_path.split(',') %>
            <% paths.each do |path| %>

              <% image_path ="/scirocco/#{@summary.project.name}/" + @summary.class_name + '/' + @summary.device + '/'  + @summary.date + '/' + path %> 
              <%= link_to image_tag(image_path , :class => "screen_shot"), image_path , :class=> "thickbox" , :rel => test_case.test_name %>
            <% end %>
            </td>
            <% if false %>
              <td><%= link_to 'Show', test_case %></td>
              <td><%= link_to 'Edit', edit_test_case_path(test_case) %></td>
              <td><%= link_to 'Destroy', test_case, :confirm => 'Are you sure?', :method => :delete %></td>
            <% end %>
          </tr>
        <% end %>
      </table>
    <% end %>



    <br />

    <% if false %>
      <%= link_to 'New Test case', new_test_case_path %>
    <% end %>
